package cn.edu.scau.cmi.carol.sex;

public class Sex {

	public static int sexToInt(String stringsex)throws Exception {
		int sex=0;
		if(stringsex.equals("male")) {
			sex=0;
		}
		else if(stringsex.equals("female")) {
			sex=1;
		}
		else {
			sex=2;
		}
		return sex;
	}
	
	public static String sexToString(int intsex)throws Exception{
		String sex="";
		if(intsex==0) {
			sex="male";
		}
		else if(intsex==1) {
			sex="female";
		}
		else {
			sex="wrong sex";
		}
		return sex;
	}
}
